package practice;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

public class Pra_T {
	 public static ArrayList<Integer> randomIntArrayList(int elementNum, 
			 int start, int end) {
		 	ArrayList<Integer> arrList = new ArrayList<>();
	        Random random = new Random();
	        for(int i = 0, bound = end - start; i < elementNum; i++)
	        	arrList.add(random.nextInt(bound) + start);
	        return arrList;
	}
	 
	 public void test() throws Throwable {
		 randomIntArrayList(10, 0, 10);
		 throw new Throwable();
	 }
	 
	public static void main(String[] args) {
		int n = 20, m = 4;
		List<Integer> list = Pra_T.randomIntArrayList(n, 10, 100);
		System.out.println("原序列：\n\t" + list);
		List<Integer> list1 = new ArrayList<>(list.subList(0, n - m));
		List<Integer> list2 = new ArrayList<>(list.subList(n - m, n));
		list.clear();
		list.addAll(list2);
		list.addAll(list1);
		System.out.println("移动后：\n\t" + list);
	}
}

interface test {
	public double mm();
//	public final double tt();
//	static void cc(double t);
//	protected void ttt();
}
